namespace MatrixFramework.Core.MultiTenancy;

/// <summary>
/// 多租户常量
/// </summary>
public static class MatrixMultiTenancyConsts
{
    /// <summary>
    /// 是否启用多租户
    /// </summary>
    public const bool IsEnabled = true;

    /// <summary>
    /// 默认租户ID
    /// </summary>
    public const string DefaultTenantId = "00000000-0000-0000-0000-000000000000";

    /// <summary>
    /// 租户ID在缓存中的前缀
    /// </summary>
    public const string CachePrefix = "matrix:tenant";

    /// <summary>
    /// 租户连接字符串格式
    /// </summary>
    public const string ConnectionStringFormat = "Server={0};Database={1}_Tenant_{2};Port={3};User Id={4};Password={5};";

    /// <summary>
    /// 租户配置键
    /// </summary>
    internal static class ConfigKeys
    {
        public const string IsMultiTenantEnabled = "MultiTenancy:IsEnabled";
        public const string DatabasePrefix = "MultiTenancy:DatabasePrefix";
        public const string ConnectionStringTemplate = "MultiTenancy:ConnectionStringTemplate";
        public const string DefaultTenantName = "MultiTenancy:DefaultTenantName";
    }

    /// <summary>
    /// 租户事件类型
    /// </summary>
    internal static class EventTypes
    {
        public const string TenantCreated = "TenantCreated";
        public const string TenantUpdated = "TenantUpdated";
        public const string TenantDeleted = "TenantDeleted";
        public const string TenantActivated = "TenantActivated";
        public const string TenantDeactivated = "TenantDeactivated";
        public const string TenantDatabaseCreated = "TenantDatabaseCreated";
        public const string TenantDatabaseMigrated = "TenantDatabaseMigrated";
    }
}